home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (c) Microsoft Corporation. All rights reserved. */
- var mSlideIdx = 0;
- var mNextSlide = "yes";
- var mTransition = RandomTrans();
- var mImgRoot = "images/";
- var mUrlWindow = 0;
- var mUrlWindowSafe = true;
- var IN = 0;
- var OUT = 1;
- var DELAY_FILTER = 25;
- var SLIDE_ROOT = "slide";
- var SLIDE_EXT = ".htm"
- var mCallNumber = 0;
- function OnLoad(){
- CenterTourContainer();
- StartSpeed();
- idTopicsTitle.innerText = L_mTopicsCaption_TEXT;
- mSlideIdx= 0 ;
- MakeVisible();
- DisplaySlide(0);
- idBody.style.visibility = "visible";
- }
- function URLWindowSafe(){
- mUrlWindowSafe = true;
- }
- function OpenURL(sURL){
- if (!mUrlWindowSafe) return;
- mUrlWindowSafe = false;
- if ( typeof(mUrlWindow.closed) == "boolean" ){
- if ( mUrlWindow.closed == false ) mUrlWindow.close();
- }
- mUrlWindow = window.open(sURL, null, "");
- window.setTimeout("URLWindowSafe()", 150);
- }
- function StartSpeed(){
- SpeedButtonOn(idSpeedButton[2]);
- mSpeed = GetSpeed(idSpeedButton[2]);
- }
- function CenterTourContainer(){
- idTourContainerLayer1.style.left =(document.body.clientWidth/2) - (idTourContainerLayer1.offsetWidth/2);
- idTourContainerLayer1.style.top =(document.body.clientHeight/2) - (idTourContainerLayer1.offsetHeight/2);
- idTourContainerLayer2.style.left =(document.body.clientWidth/2) - (idTourContainerLayer2.offsetWidth/2);
- idTourContainerLayer2.style.top =(document.body.clientHeight/2) - (idTourContainerLayer2.offsetHeight/2);
- idTourContainerLayer3.style.left =(document.body.clientWidth/2) - (idTourContainerLayer3.offsetWidth/2);
- idTourContainerLayer3.style.top =(document.body.clientHeight/2) - (idTourContainerLayer3.offsetHeight/2);
- }
- function MakeVisible(){
- idTourContainerLayer1.style.visibility = "visible";
- idTourContainerLayer2.style.visibility = "visible";
- idTourContainerLayer3.style.visibility = "visible";
- idTopicsTitle.style.visibility = "visible"; //--- Layer 3
- idTopicsContainer.style.visibility = "visible"; //--- Layer 3
- idTblTopics.style.visibility = "visible"; //--- Layer 3
- idCloseWindow.style.visibility = "visible"; //--- Layer 3
- idControlsContainer.style.visibility = "visible"; //--- Layer 3
- }
- function NextSlide(){
- if (mNextSlide == "yes") {
- mSlideIdx++;
- DisplaySlide(mSlideIdx);
- }
- }
- function ShowTip(sStr){
- idTips.innerHTML = sStr;
- setInTransition( idTipsContainer,1, 12 );
- }
- function HideTip(){
- setOutTransition( idTipsContainer,1, 12 );
- }
- function HideGlobe(sURL){
- setOutTransition(idGlobe,1, 12 );
- }
- function ShowGlobe(){
- setInTransition(idGlobe,1, 12 );
- }
- function UpdateGlobe(sURL){
- if ( sURL ){
- sURL = "url(" + mImgRoot + sURL + ")";
- idGlobe.style.backgroundImage = sURL;
- }
- }
- function setOutTransition( element, duration, transition ){
- var trsn = "revealTrans(DURATION=" + duration + ", TRANSITION=" + transition + ")";
- element.style.filter = trsn;
- if ( element.filters.revealTrans){
- if (element.filters.revealTrans.status != 2){
- element.style.visibility="visible";
- element.filters.revealTrans.apply();
- element.style.visibility="hidden";
- element.filters.revealTrans.play();
- }
- else{
- element.style.visibility="hidden";
- }
- }
- }
- function setInTransition( element, duration, transition ){
- var trsn = "revealTrans(DURATION=" + duration + ", TRANSITION=" + transition + ")";
- element.style.filter = trsn;
- if ( element.filters.revealTrans){
- if (element.filters.revealTrans.status != 2){
- element.style.visibility="hidden";
- element.filters.revealTrans.apply();
- element.style.visibility="visible";
- element.filters.revealTrans.play();
- }
- else{
- element.style.visibility="visible";
- }
- }
- }
- function DisplaySlide(nIdx){
- idTextContainer.document.location = SLIDE_ROOT + nIdx + SLIDE_EXT;
- HighlightSectionTopic(nIdx);
- ShowGlobe();
- }
- function HighlightSectionTopic(nIdx){
- var row;
- for (row = 0; row < idTblTopics.rows.length; row++ ){
- idTblTopics.rows(row).cells(0).firstChild.className = "clsTopicElementNormal";
- }
- idTblTopics.rows(nIdx).cells(0).firstChild.className = "clsTopicElementSelected";
- }
- function OnClickSections(oObj)
- {
- idTextContainer.mParent = 0;
- if ( idTips.innerText.length > 0 ) { idTips.innerHTML = ""; HideTip()};
- if (idPlayButton.STATE == 1) PlayButtonOnClick(idPlayButton);
-
- mSlideIdx = oObj.parentElement.parentElement.rowIndex;
- DisplaySlide(mSlideIdx);
- }
- function OnLoadSlide(oObj)
- {
- idTextContainer.mParent = window;
- }
- function SlideSpeed(nValue){
- idTextContainer.SlideSpeed(nValue);
- }
- function SetSlideSpeed(nValue){
- mSpeed = nValue;
- SlideSpeed(mSpeed);
- }
- function ActiveTime(nValue)
- {
- if (typeof(idActiveTime) != "undefined") idActiveTime.innerText = parseInt(nValue);
- }
- function NextTrans(){
- return (++mTransition)%24;
- }
- function RandomTrans(){
- var a = Rand(13);
- var c = Rand(17);
- return ( a + c )%24;
- }
- function Rand(base){
- seed = Math.random();
- seed = (seed * 100)% base;
- seed = Math.round(seed);
- return seed;
- }
- function CheckKeyCodes()
- {
- switch (event.keyCode)
- {
- case 27 :
- window.close();
- case 13 :
-
- default :
- }
- }
- function OnKeyUpTopic(oObj)
- {
- switch (event.keyCode)
- {
- case 13 :
- OnClickSections(oObj);
- }
- }
- function OnKeyUpSpeedButton(oObj)
- {
- switch (event.keyCode)
- {
- case 13 :
- SpeedButtonOnClick(oObj);
- }
- }
- function OnKeyUpPlayButton(oObj)
- {
- switch (event.keyCode)
- {
- case 13 :
- PlayButtonOnClick(oObj);
- }
- }
- function OnKeyUpSoundButton(oObj)
- {
- switch (event.keyCode)
- {
- case 13 :
- SoundButtonOnClick(oObj);
- }
- }
-